Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@walletconnect/events

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@walletconnect/events

Events Utils

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
7
Created

What is @walletconnect/events?

@walletconnect/events is a lightweight event emitter library designed to facilitate event-driven programming. It allows developers to create, listen to, and manage custom events within their applications.

What are @walletconnect/events's main functionalities?

Event Emission

This feature allows you to emit custom events. The code sample demonstrates how to create an event emitter instance and emit an event named 'eventName' with 'eventData'.

const { EventEmitter } = require('@walletconnect/events');
const emitter = new EventEmitter();
emitter.emit('eventName', 'eventData');

Event Listening

This feature allows you to listen for custom events. The code sample shows how to set up an event listener for 'eventName' and handle the event data when it is emitted.

const { EventEmitter } = require('@walletconnect/events');
const emitter = new EventEmitter();
emitter.on('eventName', (data) => {
  console.log('Event received:', data);
});
emitter.emit('eventName', 'eventData');

Event Removal

This feature allows you to remove event listeners. The code sample demonstrates how to add an event listener, remove it, and then emit the event to show that the listener has been removed.

const { EventEmitter } = require('@walletconnect/events');
const emitter = new EventEmitter();
const handler = (data) => {
  console.log('Event received:', data);
};
emitter.on('eventName', handler);
emitter.off('eventName', handler);
emitter.emit('eventName', 'eventData');

Other packages similar to @walletconnect/events

Keywords

FAQs

Package last updated on 25 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc